package com.zlsx.androiddemo;

import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.zlsx.androiddemo.arp.SearcherHost;
import com.zlsx.androiddemo.databinding.ActivityMainBinding;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class MainActivity extends AppCompatActivity {
    private ActivityMainBinding inflact;
    private static final String TAG = "MainActivity";
    private List<SearcherHost.DeviceBean> mDeviceBeanListm = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        inflact = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(inflact.getRoot());
       /* ARPUtil.getInstance().discover(AppUtil.getAppIp(this));
        ARPUtil.getInstance().readArp();*/
        new SearcherHost() {
            @Override
            public void onSearchStart() {
                Log.i(TAG, "开始搜索");
            }

            @Override
            public void onSearchFinish(Set deviceSet) {
                mDeviceBeanListm.addAll(deviceSet);
            }

            @Override
            public void printLog(String log) {
                Log.i(SearcherHost.class.getSimpleName(), "Searching..." + log);
            }
        }.search();
    }
}